@edmaul69
Actually since I am playing with lib cores then there is no mame tab (ex. Xmen: The Arcade) as all the controls are from retroarch. So my question should be "how can I keep user 1 from controlling user 4 and vice versa". The keys for user 1 is only binded to controller buttons and user 4 is just keyboard buttons but for some reason I can still control both players (P1 and P4) at the same time on the keyboard. Is it by default that keyboard P1 and joystick P1 are always binded to player 1, like it's hard-coded?
Edit:
I wonder if it has to do with user 4 not having a device index (set to N/A "Port #3")
Edit #2:
Okay nevermind it's solved now. I somehow unbinded the tab key so I couldn't get the mame menu to appear. So I deleted the "default.cfg" file from "/home/pi/RetroPie/roms/mame-libretro/mame2003/cfg" to reset it back to defaults.
Once I was able to bring up the mame tab (menu) then I was able to fix my issue by assigning keys to a keyboard button that I would never use (ex. F12). So for each player I made sure it was only binded to the specific controller button or keyboard button. Player 4 was called retropad 4 as well (keyboard only).